package Demo.demo15;

public class 将字符串转换为字符数组 {
    public static void main(String[] args) {
        //创建一个字符串
        String name ="asadasdf";
        //把字符串转换成字符类型的数组
        char[] chars = name.toCharArray();
        System.out.println(chars[1]);
        for (int i =0;i<chars.length;i++){
            System.out.println(chars[i]);
        }
    }
}
